Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

DEP Use PHPUnit 11 #11361

Merged
merged 1 commit into from
Sep 18, 2024
Merged

Conversation

emteknetnz
Copy link
Member

@emteknetnz emteknetnz commented Sep 4, 2024

Issue silverstripe/.github#305

PHPUnit 10 removed the ability to unit test Error's, Deprecation's, Warning's and Strict's, so I've set a custom error handler to convert all those to unit test specific exceptions instead

I've also updated a couple of dependencies which PHPUnit 11 requires:

  • nikic/php-parser
  • sebastian/diff

@emteknetnz emteknetnz force-pushed the pulls/6/phpunit11 branch 3 times, most recently from aff6913 to 0017f81 Compare September 8, 2024 22:35
@emteknetnz emteknetnz changed the title DEP Use phpunit 11 DEP Use PHPUnit 11 Sep 8, 2024
@emteknetnz emteknetnz marked this pull request as draft September 9, 2024 03:55
@emteknetnz emteknetnz force-pushed the pulls/6/phpunit11 branch 2 times, most recently from 2a5cb16 to 04ba00c Compare September 9, 2024 21:14
@@ -134,7 +134,6 @@ protected function withBaseFolder($folder, $callback)

/**
* Submit a get request
* @uses Director::test()
Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

As far as I can tell @uses was for code-coverage

I'm not sure what the replacement for @uses is sebastianbergmann/phpunit#4502

This was already not-recommended as @uses ClassName::methodName (not recommended because too fine-grained)

We're not doing any sort of code-coverage at this point

I did try using #[UsesMethod('Director', 'test')] however it will complain Attribute "PHPUnit\Framework\Attributes\UsesMethod" cannot target method (allowed targets: class)

I've elected to just remove these instead

@emteknetnz emteknetnz force-pushed the pulls/6/phpunit11 branch 4 times, most recently from 5f8c960 to eae82cf Compare September 10, 2024 06:04
@emteknetnz emteknetnz force-pushed the pulls/6/phpunit11 branch 3 times, most recently from 7101d11 to 9238c84 Compare September 10, 2024 23:58
@emteknetnz emteknetnz force-pushed the pulls/6/phpunit11 branch 6 times, most recently from 9878ee6 to 8bdeb50 Compare September 13, 2024 00:21
@emteknetnz emteknetnz marked this pull request as ready for review September 16, 2024 21:43
Copy link
Member

@GuySartorelli GuySartorelli left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Mostly looks good, few changes requested.

I won't look at the other module PRs just yet as they may need to change based on the changes I've requested.

src/Dev/SapphireTest.php Show resolved Hide resolved
tests/php/Control/HTTPRequestTest.php Outdated Show resolved Hide resolved
tests/php/Core/ObjectTest.php Show resolved Hide resolved
tests/php/ORM/DBSchemaManagerTest.php Outdated Show resolved Hide resolved
@emteknetnz emteknetnz force-pushed the pulls/6/phpunit11 branch 2 times, most recently from b1592ce to 540fcd7 Compare September 16, 2024 23:57
Copy link
Member

@GuySartorelli GuySartorelli left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM, will merge once all other PRs are approved

@emteknetnz emteknetnz force-pushed the pulls/6/phpunit11 branch 2 times, most recently from a25843e to e2010cf Compare September 17, 2024 23:39
Copy link
Member

@GuySartorelli GuySartorelli left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Changes approved

@GuySartorelli GuySartorelli merged commit 7793664 into silverstripe:6 Sep 18, 2024
5 of 12 checks passed
@GuySartorelli GuySartorelli deleted the pulls/6/phpunit11 branch September 18, 2024 03:30
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants